﻿using System;
using System.Collections.Generic;
using System.Text;
using AgilePlannerDT.Data;

namespace AgilePlannerDT.Application.Commands.Impl
{
    public class StoryCardCreateCommand : ApCommandImpl
    {
        StoryCard after;

        public StoryCardCreateCommand(AgilePlannerApplication app, StoryCard after)
            : base(app)
        {
            this.after = after;
        }

        public override void Undo()
        {
            if (!isUndone)
            {
                app.Persister.DeleteStoryCard(after.ID);
                base.Undo();
            }
        }

        public override void Redo()
        {
            if (IsUndone)
            {
                app.Persister.UndeleteStoryCard(after);
                base.Redo();
            }
        }
    }
}
